/*
Copyright 2023 Sangfor Technologies Inc.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package operations

// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command

import (
	"net/http"

	"github.com/go-openapi/runtime"

	"arsenal/models"
)

// PostFaultsOKCode is the HTTP code returned for type PostFaultsOK
const PostFaultsOKCode int = 200

/*
PostFaultsOK Response successfully

swagger:response postFaultsOK
*/
type PostFaultsOK struct {

	/*
	  In: Body
	*/
	Payload *models.Nr200Response `json:"body,omitempty"`
}

// NewPostFaultsOK creates PostFaultsOK with default headers values
func NewPostFaultsOK() *PostFaultsOK {

	return &PostFaultsOK{}
}

// WithPayload adds the payload to the post faults o k response
func (o *PostFaultsOK) WithPayload(payload *models.Nr200Response) *PostFaultsOK {
	o.Payload = payload
	return o
}

// SetPayload sets the payload to the post faults o k response
func (o *PostFaultsOK) SetPayload(payload *models.Nr200Response) {
	o.Payload = payload
}

// WriteResponse to the client
func (o *PostFaultsOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {

	rw.WriteHeader(200)
	if o.Payload != nil {
		payload := o.Payload
		if err := producer.Produce(rw, payload); err != nil {
			panic(err) // let the recovery middleware deal with this
		}
	}
}

// PostFaultsBadRequestCode is the HTTP code returned for type PostFaultsBadRequest
const PostFaultsBadRequestCode int = 400

/*
PostFaultsBadRequest Input fault injection object error

swagger:response postFaultsBadRequest
*/
type PostFaultsBadRequest struct {

	/*
	  In: Body
	*/
	Payload *models.Error400Response `json:"body,omitempty"`
}

// NewPostFaultsBadRequest creates PostFaultsBadRequest with default headers values
func NewPostFaultsBadRequest() *PostFaultsBadRequest {

	return &PostFaultsBadRequest{}
}

// WithPayload adds the payload to the post faults bad request response
func (o *PostFaultsBadRequest) WithPayload(payload *models.Error400Response) *PostFaultsBadRequest {
	o.Payload = payload
	return o
}

// SetPayload sets the payload to the post faults bad request response
func (o *PostFaultsBadRequest) SetPayload(payload *models.Error400Response) {
	o.Payload = payload
}

// WriteResponse to the client
func (o *PostFaultsBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {

	rw.WriteHeader(400)
	if o.Payload != nil {
		payload := o.Payload
		if err := producer.Produce(rw, payload); err != nil {
			panic(err) // let the recovery middleware deal with this
		}
	}
}

// PostFaultsInternalServerErrorCode is the HTTP code returned for type PostFaultsInternalServerError
const PostFaultsInternalServerErrorCode int = 500

/*
PostFaultsInternalServerError Server error while processing the request

swagger:response postFaultsInternalServerError
*/
type PostFaultsInternalServerError struct {

	/*
	  In: Body
	*/
	Payload *models.Error500Response `json:"body,omitempty"`
}

// NewPostFaultsInternalServerError creates PostFaultsInternalServerError with default headers values
func NewPostFaultsInternalServerError() *PostFaultsInternalServerError {

	return &PostFaultsInternalServerError{}
}

// WithPayload adds the payload to the post faults internal server error response
func (o *PostFaultsInternalServerError) WithPayload(payload *models.Error500Response) *PostFaultsInternalServerError {
	o.Payload = payload
	return o
}

// SetPayload sets the payload to the post faults internal server error response
func (o *PostFaultsInternalServerError) SetPayload(payload *models.Error500Response) {
	o.Payload = payload
}

// WriteResponse to the client
func (o *PostFaultsInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {

	rw.WriteHeader(500)
	if o.Payload != nil {
		payload := o.Payload
		if err := producer.Produce(rw, payload); err != nil {
			panic(err) // let the recovery middleware deal with this
		}
	}
}
